﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using micsun;

namespace tmsWeb
{
    public partial class Error : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HlkBack.NavigateUrl = "~/" + micsun.Logic.micsunConfiguration.NamedPage["home"].ToString();
            Response.Expires = 0;
            lbBulletin.Text = "出错拉！";
            if (Request.QueryString["err"] != null)
            {

                lbErrorMessage.Text = Request.QueryString["err"];
                if (Request.QueryString["Log"] == string.Empty)
                    ExceptionLog.Write(null, "User IP:" + Request.UserHostName + " Error:" + lbErrorMessage.Text);
            }
            else
            {
                Exception ex = Server.GetLastError();
                if (ex != null)
                {
                    lbErrorMessage.Text = ex.Message;
                }
                else
                    lbErrorMessage.Text = "未知错误，请与管理员联系！";
            }
            Server.ClearError();
        }
    }
}
